/**
 * 一、将下面的异步代码使用Promise的方式改进
 
setTimeout(function () {
    var a = 'hello '
    setTimeout(function () {
        var b = 'lagou '
        setTimeout(function () {
            var c = 'i love u'
            console.log(a + b + c);
        }, 10)
    }, 10)
}, 10)
*/

var a = new Promise((resolve, reject) => {
    resolve('hello')
})
var b = new Promise((resolve, reject) => {
    resolve('lagou')
})
var c = new Promise((resolve, reject) => {
    resolve('I love u')
})
Promise.all([a, b, c]).then(res => {
    let result = ''
    res.forEach(item => {
        result += item + ' '
    })
    console.log(result)
})


